<?php

namespace App\Transformers\Web;

use League\Fractal\TransformerAbstract;

class WebStudentResultTransformer extends TransformerAbstract
{
    public function transform($emigrated)
    {
        return [
            'id' => $emigrated->id,
            'username' => $emigrated->username,
            "examination_id" => $emigrated->examination_id,
            'already_num' => $emigrated->already_num,
            'all_num' => $emigrated->all_num,
            'submit_type' => $emigrated->submit_type,
            'created_at' => $emigrated->created_at->format('Y-m-d H:i:s') ?? null,
            'subject_id' => $emigrated->subject
        ];
    }
}

